import React, { Component } from 'react'
import connect from './store/connect'

class CountButton extends Component {

  handleClick(){
    if(this.props.children==='+'){
      this.props.countIncrement();
    }else{
      this.props.countDecrement();
    }
  }

  render() {
    return (
      <div>
        <button onClick={()=>this.handleClick()}>{this.props.children}</button>
      </div>
    )
  }
}

export default connect(CountButton)
